package com.szosen.application;

import com.szosen.jkzj.activity.LoginActivity;
import com.szosen.jkzj.activity.MainActivity;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class AutoRunReceiver extends BroadcastReceiver {
	static final String action_boot = "android.intent.action.BOOT_COMPLETED";

	@Override
	public void onReceive(Context context, Intent intent) {
		System.out.println(intent.getAction() + "打印的intent");
		if (intent.getAction().equals(action_boot)) {
			Intent autoRunIntent = new Intent(context, LoginActivity.class);
			autoRunIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
			context.startActivity(autoRunIntent);
		}
	}
}
